package com.qf.dao;

import com.qf.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author jiangjingbo
 * @version V1.0
 * @Project java2203
 * @Package com.qf.dao
 * @Description:
 * @Date 2022/6/30 20:06
 */

public interface Userdao {

    @Select("select * FROM t_users")
    public List<User> findAll();

    @Insert(" INSERT into t_users (name,password,sex,birthday,registTime) value(#{user.name},#{user.password} ,#{user.sex},#{user.birthday},#{user.registTime})")
    public int addUser(@Param("user") User user);

    @Update("update t_users set name=#{user.name} ,`password`=#{user.password} ,sex=#{user.sex} ,birthday=#{user.birthday} , registTime=#{user.registTime} where id=#{user.id}")
    public int updata(@Param("user") User user);

    @Delete("delete from t_users where  id=#{id}")
    public int delete(@Param("id") int id);
    @Select("select * FROM t_users where id=#{id}")
    public  User findUserid(@Param("id")int id);
}
